package com.itheima.wms.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.itheima.pinda.base.entity.Entity;
import com.itheima.pinda.base.entity.SuperEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
import lombok.experimental.SuperBuilder;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

import static com.baomidou.mybatisplus.annotation.SqlCondition.EQUAL;
import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 货品管理
 * </p>
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@SuperBuilder
@TableName("wms_goods")
@ApiModel(value = "Goods", description = "货品管理")
public class GoodsEntity extends Entity<Long> {

    private static final long serialVersionUID = 1L;

    /**
     * 货品类型ID
     */
    @ApiModelProperty(value = "货品类型ID")
    @NotNull(message = "货品类型ID不能为空", groups = {Save.class})
    @TableField(value = "goods_type_id")
    private Long goodsTypeId;
    /**
     * 编码
     */
    @ApiModelProperty(value = "编码")
    @NotEmpty(message = "编码不能为空", groups = {Save.class})
    @Length(max = 50, message = "编码长度不能超过50")
    @TableField(value = "code")
    private String code;
    /**
     * 名称
     */
    @ApiModelProperty(value = "名称")
    @NotEmpty(message = "名称不能为空", groups = {Save.class})
    @Length(max = 50, message = "名称长度不能超过50")
    @TableField(value = "name")
    private String name;
    /**
     * 条码
     */
    @ApiModelProperty(value = "条码")
    @NotEmpty(message = "条码不能为空", groups = {Save.class})
    @Length(max = 50, message = "条码长度不能超过50")
    @TableField(value = "bar_code")
    private String barCode;
    /**
     * 货主名称
     */
    @ApiModelProperty(value = "货主名称")
    @NotNull(message = "货主名称不能为空", groups = {Save.class})
    @TableField(value = "owner_id")
    private Long ownerId;
    /**
     * 质检方式 不处理:BCL、全检:QJ、抽检:CJ
     */
    @ApiModelProperty(value = "质检方式 不处理:BCL、全检:QJ、抽检:CJ")
    @NotEmpty(message = "质检方式 不处理:BCL、全检:QJ、抽检:CJ不能为空", groups = {Save.class})
    @Length(max = 10, message = "质检方式 不处理:BCL、全检:QJ、抽检:CJ长度不能超过10")
    @TableField(value = "inspection_type")
    private String inspectionType;
    /**
     * 温度要求 常温:CW、冷藏:LC、恒温:HW
     */
    @ApiModelProperty(value = "温度要求 常温:CW、冷藏:LC、恒温:HW")
    @NotEmpty(message = "温度要求 常温:CW、冷藏:LC、恒温:HW不能为空", groups = {Save.class})
    @Length(max = 10, message = "温度要求 常温:CW、冷藏:LC、恒温:HW长度不能超过10")
    @TableField(value = "temperature_type")
    private String temperatureType;
    /**
     * 承重要求 重型:ZX、轻型:QX 中型:BX
     */
    @ApiModelProperty(value = "承重要求 重型:ZX、轻型:QX、中型:BX")
    @NotEmpty(message = "承重要求 重型:ZX、轻型:QX、中型:BX 不能为空", groups = {Save.class})
    @Length(max = 10, message = "承重要求 重型:ZX、轻型:QX、中型:BX 长度不能超过10")
    @TableField(value = "bearing_type")
    private String bearingType;
    /**
     * 体积
     */
    @ApiModelProperty(value = "体积")
    @NotNull(message = "体积不能为空", groups = {Save.class})
    @TableField(value = "volume")
    private java.math.BigDecimal volume;
    /**
     * 仓库id
     */
    @ApiModelProperty(value = "仓库id")
    @TableField(value = "warehouse_id")
    private Long warehouseId;
    /**
     * 库区id
     */
    @ApiModelProperty(value = "库区id")
    @TableField(value = "area_id")
    private Long areaId;
    /**
     * 单价
     */
    @ApiModelProperty(value = "单价")
    @TableField(value = "price")
    private java.math.BigDecimal price;
    /**
     * 单位
     */
    @ApiModelProperty(value = "单位")
    @Length(max = 10, message = "单位长度不能超过10")
    @TableField(value = "unit")
    private String unit;
    /**
     * 保质天数
     */
    @ApiModelProperty(value = "保质天数")
    @TableField(value = "guarantee_day")
    private Integer guaranteeDay;
    /**
     * 状态
     */
    @ApiModelProperty(value = "状态")
    @TableField(value = "status")
    private Integer status;
    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    @Length(max = 255, message = "备注长度不能超过255")
    @TableField(value = "remark")
    private String remark;
    /**
     * 创建人
     */
    @ApiModelProperty(value = "创建人")
    @Length(max = 50, message = "创建人长度不能超过50")
    @TableField(value = "create_name", fill = FieldFill.INSERT)
    private String createName;
    /**
     * 更新人
     */
    @ApiModelProperty(value = "更新人")
    @Length(max = 50, message = "更新人长度不能超过50")
    @TableField(value = "update_name", fill = FieldFill.INSERT_UPDATE)
    private String updateName;
    /**
     * 逻辑删除 0 删除
     */
    @ApiModelProperty(value = "逻辑删除 0 删除")
    @TableField(value = "logic_del")
    private Integer logicDel;
}
